#include "stdafx.h"
#include "ScreenRecv.h"

class Main : public base::Frame
{
protected:
	ScreenRecv	scrRecv;

	void OnDraw(base::DC* dc)
	{
		scrRecv.ScreenBitmap()->Draw(*dc);
	}
	void OnCreate()
	{
		scrRecv.Initialize(this);
	}
	void OnClose(base::Message* msg)
	{
		scrRecv.WaitClose();
	}
public:
	Main()
	{
		Param->AddExStyle(WS_EX_COMPOSITED);
		EventCreate.Add(this,&Main::OnCreate);
		EventDraw.Add(this,&Main::OnDraw);
		GetMsgHook(WM_CLOSE)->Add(this,&Main::OnClose);
	}
};

WINMAIN
{
	base::MsgLoop ml;
	Main main;
	main.Create();
	return ml.Start();
};